package com.aivin.leakcanarysample.tool;
import android.app.Activity;
import java.util.ArrayList;
import java.util.List;

public class ActivityManage {
    private static ActivityManage activityManage;
    // static 对象持有 activity ，导致 activity 不能释放，然后内存泄漏
    private static List<Activity> list = new ArrayList<>();
    private ActivityManage() {
    }
    public static ActivityManage get() {
        if (activityManage == null) {
            activityManage = new ActivityManage();
        }
        return activityManage;
    }

    public void add(Activity activity) {
        list.add(activity);
    }

}
